//
//  WdVC.swift
//  Auscultation
//
//  Created by 来 on 2020/11/28.
//

import UIKit

class WdVC: BaseVC {
    
    var tx: UIImageView!
    var mz: UILabel!

    override func viewDidLoad() {
        super.viewDidLoad()

        initUI()
        tx.lgf_setImage(EWEUser.lgf.avatar)
        mz.text = EWEUser.lgf.realName
    }
    

    @objc func logout(_ sender: UIButton) {
        EWERequest.lgf("login", [:], .delete) { (data) in
            // 获取 token
            EWEUser.logout()
            let appDelegate = UIApplication.shared.delegate as! AppDelegate
            appDelegate.window?.rootViewController = MainNaviVC.init(rootViewController: LoginVC())
        } _: { (error) in
            SVProgressHUD.showError(error)
        }
    }
    
    @objc func shezhi(_ sender: UITapGestureRecognizer) {
        let vc = XxwsVC()
        vc.type = 2
        self.navigationController?.show(vc, sender: self)
    }

}
